package com.cai.servlet.main;

import com.cai.dao.DetailedUserDao;
import com.cai.dao.impl.DetailedUserDaoImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author RuoLi
 */
@WebServlet(name = "ServletUserMainEditUserInfo", value = "/userMain/editUserInfo")
public class ServletCustomerEditInfo extends HttpServlet {
    DetailedUserDao userDao = new DetailedUserDaoImpl();

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String account = req.getParameter("userAccount");
        String param = req.getParameter("param");
        String paramName=req.getParameter("paramName");
        //修改信息
        int count = userDao.editDetailedUserData(account,param,paramName);
        resp.getWriter().write(String.valueOf(count));
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        super.doPost(req, resp);
    }
}
